//package com.xshang.aspect;
//
//import lombok.extern.slf4j.Slf4j;
//import org.simplespringframework.annotation.Controller;
//import org.simplespringframework.aop.annotation.Aspect;
//import org.simplespringframework.aop.annotation.Order;
//import org.simplespringframework.aop.aspect.DefaultAspect;
//
//import java.lang.reflect.Method;
//
//@Aspect(value = Controller.class)
//@Order(0)
//@Slf4j
//public class ControllerTimeCalculatorAspect extends DefaultAspect {
//
//    private long timestampClass;
//
//
//    @Override
//    public void before(Class<?> targetClass, Method method, Object[] args) throws Throwable {
//        log.info("开始计时,执行的类是[{}],执行的方法是[{}],参数是[{}]",
//                targetClass.getName(),method.getName(),args
//                );
//        timestampClass = System.currentTimeMillis();
//    }
//
//    @Override
//    public Object afterReturning(Class<?> targetClass, Method method, Object[] args, Object returnValue) throws Throwable {
//        long endTime = System.currentTimeMillis();
//        long constTime = endTime - timestampClass;
//        log.info("结束计时,执行的类是[{}],执行的方法是[{}],参数是[{}],返回值是[{}],执行耗时[{}]",
//                targetClass.getName(),method.getName(),args,returnValue,constTime
//        );
//        return returnValue;
//    }
//
//    @Override
//    public void afterThrowing(Class<?> targetClass, Method method, Object[] args, Throwable throwable) throws Throwable {
//    }
//}
